<form name="frmModal" method="post" action="proc/admin/detil_prestasipelanggaran.php">
<input type="hidden" value="deprepel-edit" name="proc" />
<h2 class="dialog_title"><span>Edit Detil Reward/Punishment</span></h2>
<div class="dialog_content">
<div style="border-bottom: 1px solid #CCC">
<?php $result = deprepel_load($deprepel_id)?>
<?php $result = mysql_fetch_assoc($result)?>
<?php $result2 = mysql_fetch_assoc(perpel_load($result['ACHIEV_ID']));?>
<table width="100%" border="0" cellpadding="5" cellspacing="0">
	<tr>
		<td align="right" width="35%">ID Detil R/P :</td>
		<td><input name="deprepel_id-fake" type="text" value="<?php echo $result['DETACHIEV_ID'] ?>" maxlength="5" readonly="readonly" />
		  <input type="hidden" name="deprepel_id" value="<?php echo $result['DETACHIEV_ID'] ?>" /></td>
		<td width="35%" align="left" valign="middle">
			<!-- <input type="checkbox" name="rnp_id_generate" title="auto generate" 
				onchange="var fr = $(this).getParent('form'); 
							fr.rnp_id.set('disabled', this.checked).set('value', this.checked? 'auto generate' : '')"> -->
		</td>
	</tr>
	<tr>
		<td align="right">Nama :</td>
		<td colspan="2"><input name="deprepel_nama" type="text" value="<?php echo $result['DETACHIEV_NAMA'] ?>" maxlength="30"></td>
	</tr>
	<tr>
	  <td align="right">Tingkat :</td>
	  <td colspan="2"><input name="deprepel_tingkat" type="text" value="<?php echo $result['DETACHIEV_TINGKAT'] ?>" maxlength="45"></td>
	  </tr>
	<tr>
	  <td align="right">Tipe : </td>
	  <td colspan="2"><select name="prepel_jenis" onchange="$('prepel_jenis_'+this.value).show(); $('prepel_jenis_'+(this.value==1? 2:1)).hide()">
	    <option value="1" <?php echo strtolower($result2['ACHIEV_JENIS'])==='prestasi'? "selected=\"selected\"": "" ?> >Prestasi</option>
	    <option value="2" <?php echo strtolower($result2['ACHIEV_JENIS'])==='pelanggaran'? "selected=\"selected\"": "" ?> >Pelanggaran</option>
	    </select></td>
	  </tr>
	<tr>
	  <td align="right">Bidang :</td>
	  <td colspan="2"><select id="prepel_jenis_1" name="prepel_id[1]"  style="<?php echo strtolower($result2['ACHIEV_JENIS'])!=='prestasi'? "display:none": "" ?>">
	    <?php $acc = perpel_select2(false, "ACHIEV_JENIS='prestasi'", "ACHIEV_BIDANG ASC") ?>
	    <?php while ($row = mysql_fetch_assoc($acc)): ?>
	    <option value="<?php echo $row['ACHIEV_ID']?>" <?php echo $result2['ACHIEV_ID']==$row['ACHIEV_ID']? "selected=\"selected\"": "" ?> ><?php echo $row['ACHIEV_BIDANG']?></option>
	    <?php endwhile;?>
	    </select>
	    <select id="prepel_jenis_2" name="prepel_id[2]" style="<?php echo strtolower($result2['ACHIEV_JENIS'])!=='pelanggaran'? "display:none": "" ?>">
	      <?php $acc = perpel_select2(false, "ACHIEV_JENIS='pelanggaran'", "ACHIEV_BIDANG ASC") ?>
	      <?php while ($row = mysql_fetch_assoc($acc)): ?>
	      <option value="<?php echo $row['ACHIEV_ID']?>" <?php echo $result2['ACHIEV_ID']==$row['ACHIEV_ID']? "selected=\"selected\"": "" ?> ><?php echo $row['ACHIEV_BIDANG']?></option>
	      <?php endwhile;?>
	      </select></td>
	  </tr>
	</table>
</div>
<div class="dialog_buttons"><input type="button" value="Save"
	name="save" onclick="doSave($(this).getParent('form')); FBModal_hide()" />
<input type="button" value="Close" name="close" onclick="FBModal_hide()" />
</div>
</div>
</form>